<template>
  <van-nav-bar
    left-arrow
    left-text="返回"
  >
    <template #right>
      <van-button
        class="search-btn"
        icon="search"
        round
        size="small"
        type="info"
        @click="goSearch"
      >搜索</van-button>
      <van-icon @click="showChannelPopup" name="bars" />
    </template>
    <template #left>
      <img
        alt="黑马logo"
        class="logo_img"
        src="../logo.png"
      />
    </template>
  </van-nav-bar>
</template>

<script>
export default {
  name: "NavBar",
  components: {},
  data() {
    return {};
  },
  methods: {
    showChannelPopup() {
      this.$bus.$emit('showChannelPopup')
    },
    goSearch() {
      this.$router.push('/search')
    }
  }
};
</script>

<style scoped lang="stylus">
.logo_img
  height 33px
.search-btn
  width 175px
  height 32px
  background-color #5babfb
  .van-icon-search
    color #fff
.van-icon-bars
  color #fff
  font-size 24px
  margin-right -8px
</style>